﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;


namespace WpfApplication4.aduc
{
    /// <summary>
    /// Interaction logic for Aduc.xaml
    /// </summary>
    public partial class Aduc : System.Windows.Controls.StackPanel, WpfApplication4.Window1.clickableInterface
    {

        private Aduc_Window win = new Aduc_Window();

        public Aduc()
        {
            InitializeComponent();


            // Register mouse click event
            //this.MouseDown += new MouseButtonEventHandler(this.my_MouseDown);

            //Uri ur = new Uri("c:/64.jpg", UriKind.RelativeOrAbsolute);
            //this.Source = new System.Windows.Media.Imaging.BitmapImage(ur);


            // Define architecture of microprocessor
            win.a_communicatorDAS.registerResource(win.a_sram);
            win.a_core.registerDAS(win.a_communicatorDAS);
            win.a_communicatorRAS.registerResource(win.a_rom);
            win.a_core.registerPAS(win.a_communicatorRAS);
            win.a_communicatorDAS.addMapping(0, win.a_sram, 0);

            // Register portClock messages will call tick()
            portClock.registerCallback(tick);
            
      
        }


        public void leftDown()
        {
            win.Show();
        }

        public void tick(long x)
        {
            win.a_core.tick();
        }

    }




}
